"use strict"
const fp = require('lodash/fp')
const mysql = require('mysql2/promise')


module.exports = (data, con) => {
    const values = fp(data).map(i => `('${i.category_id}','${i.category_name}','${i.category_url}',${i.live_id})`).uniq().join(',')
    
    const insert_sql = `INSERT INTO qyg_live_categories(cid, name, url, live_id) VALUES ${values}`
    
    return con.query(insert_sql)
}